'use strict';
module.exports = app => {
  const { STRING, INTEGER } = app.Sequelize;
    return app.model.define(
      'alarm',
      {
          id: {type: INTEGER, primaryKey: true, autoIncrement: true},
          device_no: STRING(255),
          type: STRING(255),
          level: STRING(255),
          message: STRING(255),
          status: INTEGER(11),
          bus_id: INTEGER(11),
          bus_val: STRING(255),
          bus_unit: STRING(255),
          alarm_no: STRING(255),
      },
      {
          tableName: 'alarm',
          timestamps: true, // 启用时间戳(createdAt, updatedAt)
          updatedAt: false, // 不想要 updatedAt
          createdAt: true, // 想要  createdAt 但是希望名称叫做 created_at
      }
  );
};
